package defsvc

import (
	"git.cloud.inspur.com/ichain/ichain-sdk-go/pkg/common/discovery"
	"git.cloud.inspur.com/ichain/ichain-sdk-go/pkg/common/options"
	"git.cloud.inspur.com/ichain/ichain-sdk-go/pkg/ichain_sdk/provider/chpvdr"
	"git.cloud.inspur.com/ichain/ichain-sdk-go/pkg/providers/ichain"
)

type ProviderFactory struct{}

func NewProviderFactory() *ProviderFactory {
	f := ProviderFactory{}
	return &f
}

func (f *ProviderFactory) CreateLocalDiscoveryProvider(config ichain.EndpointConfig) (ichain.LocalDiscoveryProvider, error) {
	return discovery.NewLocalProvider(config)
}

func (f *ProviderFactory) CreateChainProvider(config ichain.EndpointConfig, opts ...options.Opt) (ichain.ChainProvider, error) {
	return chpvdr.New(config, opts...)
}
